package cn.tedu.collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ArrayToListDemo {
    public static void main(String[] args) {
        String[] array = {"one","two","three","four","five"};
        System.out.println(Arrays.toString(array));
        List<String> list = Arrays.asList(array);
        System.out.println(list);
        list.set(1,"six");
        System.out.println(list);
        List<String> list2 = new ArrayList<>();
        list2.add(String.valueOf(list));
        System.out.println(list2);
        List<String> list3 = new ArrayList<>(list);
        System.out.println("list3:"+list3);
        list3.add("seven");
        System.out.println(list3);

    }
}
